﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using System.Globalization;

namespace Brain
{
    public static class ColorUtil
    {
        public static Color Red
        {
            get { return new Color(1, 0f, 0f); }
        }
        public static Color Blue
        {
            get { return new Color(0, 0f, 1f); }
        }
        public static Color Green
        {
            get { return new Color(0, 1f, 0f); }
        }
        public static Color Yellow
        {
            get { return new Color(1f, 1f, 0f); }
        }
        public static Color Pink
        {
            get { return new Color(1f, 192 / 255f, 203 / 255f); }
        }

        public static Color ModifyAlpha(Color color, byte alpha)
        {
            return new Color(color.R, color.G, color.B, alpha);
        }

        /// <summary>
        /// Multiplies one color by another
        /// </summary>
        /// <param name="color1"></param>
        /// <param name="color2"></param>
        /// <returns></returns>
        public static Color Multiply(Color color1, Color color2)
        {
            Vector4 col1 = color1.ToVector4();
            Vector4 col2 = color2.ToVector4();
            return new Color(col1.X + col2.X, col1.Y + col2.Y, col1.Z + col2.Z);
        }

        /// <summary>
        /// Gives a Random Color, with Alpha = 255
        /// </summary>
        /// <returns></returns>
        public static Color Random()
        {
            return new Color(
                (byte)(RandomUtil.Next(0, 256)),
                (byte)(RandomUtil.Next(0, 256)),
                (byte)(RandomUtil.Next(0, 256)));
        }
    }
}
